<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!--1.引入vue框架-->
    <script src="vue.js"></script>
</head>
<body>
    <!--2.定义页面-->
    <div id="app">
        <input type="text" v-model="cityname" />
    </div>
</body>
<script>
    //3.声明vue对象
    var vm=new Vue({
        el:"#app",  //根元素
        data:{    //定义变量
            cityname:"shanghai"
        },
        methods: {
            //定义方法
        },
        watch:{       //对某个内容的监听
            cityname (newName,oldName){
                console.log(newName,oldName)
            }
        }
    })
</script>
</html>